package com.signway.module_signway_adapter_Api;

import android.content.Context;
import android.util.Log;

import com.signway.open.api.IOpenMcuApi;

/*
 * -----------------------------------------------------------------
 * Copyright (C) 2011-2019, by your Signway, All rights reserved.
 * -----------------------------------------------------------------
 *
 * ProjectName: droid5119
 *
 * Author: Administrator
 *
 * Email: pf.wang@Signway.cn
 *
 * Description:微控制处理器mcu
 *
 * -----------------------------------------------------------------
 * 2019-6-27 : Create SignwayMcuApi.java
 * -----------------------------------------------------------------
 */
public class SignwayMcuApi implements IOpenMcuApi {

    private static final String TAG = SignwayMcuApi.class.getName();
    private static SignwayMcuApi mSignwayMcuApi;
    private static Context mContext;

    public static synchronized SignwayMcuApi getInstance(Context context) {
        mContext = context;
        if (mSignwayMcuApi == null) {
            mSignwayMcuApi = new SignwayMcuApi(context);
        }
        return mSignwayMcuApi;
    }

    public SignwayMcuApi(Context context) {
        this.mContext = context;
    }

    /**
     * 开启串口读取线程
     */
    @Override
    public void openUart() {
        Log.i(TAG, "openUart: ");
//        RTDComm.getInstance().startWatchDog();
    }

    @Override
    public boolean gpioPinOutput(int gpioGroup, int gpioNum, int value) {
        return false;
    }

    @Override
    public int getGpioInput(int gpioGroup, int gpioNum) {
        return 0;
    }

    @Override
    public void Droid_uart_ioctrl(byte[] cptr, int Cmd, int[] Aux, byte[] pBuffer, int offset) {
        Log.i(TAG, "Droid_uart_ioctrl: ");
    }

    @Override
    public String getMcuVersion() {
        return null;
    }


}
